package com.frxuexi.lib_base

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController

@Composable
fun MyTitleBar(navHostController:NavHostController,title:String) {
        Box(Modifier.padding(20.dp, 10.dp)) {
            Image(
                imageVector = Icons.Default.ArrowBack,
                contentDescription = "",
                Modifier.clickable {
                    //返回上个页面
                    navHostController.popBackStack()
                })
            Text(text = title, Modifier.fillMaxWidth(), textAlign = TextAlign.Center)
        }
}